import dayjs from "dayjs";
import Gantt from "./components/gantt/index";
import { TaskProps } from "./components/gantt/types";
import useStore from "./components/gantt/store";
const tasks: TaskProps[] = [
  {
    id: "1",
    name: "Task 1Task 1Task 1Task 1Task 1Task 1Task 1Task 1Task 1Task 1Task 1",
    startDate: dayjs("20240102"),
    endDate: dayjs("20240120"),
    toggle: true,
    level: 1,
    children: [
      {
        id: "1-1",
        name: "Task 1-1",
        startDate: dayjs("20240104"),
        endDate: dayjs("20240120"),
        toggle: true,
        level: 2,
        children: [
          {
            id: "1-1-1",
            name: "Task 1-1-1",
            level: 3,
            startDate: dayjs("20240204"),
            endDate: dayjs("20240105"),
          },
          {
            id: "1-1-2",
            name: "Task 1-1-2",
            level: 3,
            startDate: dayjs("20240204"),
            endDate: dayjs("20240120"),
          },
        ],
      },
      {
        id: "1-2",
        name: "Task 1-2",
        level: 2,
        startDate: dayjs("20240202"),
        endDate: dayjs("20240108"),
      },
    ],
  },
  {
    id: "2",
    name: "Task 2",
    level: 1,
    startDate: dayjs("20240104"),
    endDate: dayjs("20240108"),
  },
  {
    id: "3",
    name: "Task 3",
    level: 1,
    startDate: dayjs("20240102"),
    endDate: dayjs("20240105"),
    toggle: true,
    children: [
      {
        id: "3-1",
        name: "Task 3-1",
        startDate: dayjs("20240104"),
        endDate: dayjs("20240120"),
        toggle: true,
        level: 2,
        children: [
          {
            id: "3-1-1",
            name: "Task 3-1-1",
            level: 3,
            startDate: dayjs("20240204"),
            endDate: dayjs("20240105"),
          },
          {
            id: "3-1-2",
            name: "Task 3-1-2",
            level: 3,
            startDate: dayjs("20240204"),
            endDate: dayjs("20240120"),
          },
        ],
      },
      {
        id: "3-2",
        name: "Task 3-2",
        level: 2,
        startDate: dayjs("20240202"),
        endDate: dayjs("20240108"),
      },
    ],
  },
];

const App = () => {
  const setTasks = useStore((state) => state.setTasks);
  setTasks(tasks);
  return (
    <div>
      <Gantt height={300} />
    </div>
  );
};

export default App;
